﻿namespace EzDesk.DesktopClient.ViewModel
{
    using EzDesk.DesktopClient.ViewContract;
    using EzDesk.MVVMBase;
    using EzDesk.DesktopClient.MVVMEnhance;
    using EzDesk.DesktopClient.Event;
    public class ShellViewModel : ViewModelWithSingleContainer<IShellView>
    {
        public ShellViewModel()
            : base()
        {
            Init();
        }

        private void Init()
        {
            InitEvent();
        }

        private void InitEvent()
        {
            this.View.Activated += new System.EventHandler(View_Activated);
            this.View.LocationChanged += new System.EventHandler(View_LocationChanged);
        }

        void View_LocationChanged(object sender, System.EventArgs e)
        {
            MainWindowMoveEvent.Instance.Publish(new MainWindowMoveArgs { MainWindow = this.View });
        }

        void View_Activated(object sender, System.EventArgs e)
        {
            MainWindowFocusEvent.Instance.Publish(new MainWindowFocusArgs() { MainWindow = this.View});
        }

        public void MockUserLogin()
        {
            UserManagement.Instance.Login("superwolf", "");
        }
    }
}